import request from '@/utils/request'

// 查询接口参数配置列表
export function listExcPortConfig(query) {
  return request({
    url: '/pm/excPortConfig/list',
    method: 'get',
    params: query
  })
}

// 查询接口参数配置详细
export function getExcPortConfig(id) {
  return request({
    url: '/pm/excPortConfig/' + id,
    method: 'get'
  })
}

// 新增接口参数配置
export function addExcPortConfig(data) {
  return request({
    url: '/pm/excPortConfig',
    method: 'post',
    data: data
  })
}

// 修改接口参数配置
export function updateExcPortConfig(data) {
  return request({
    url: '/pm/excPortConfig',
    method: 'put',
    data: data
  })
}

// 删除接口参数配置
export function delExcPortConfig(id) {
  return request({
    url: '/pm/excPortConfig/' + id,
    method: 'delete'
  })
}

// 导入接口参数配置
export function importExcPortConfig( data, saveType = 1) {
  return request({
    url: `/pm/excPortConfig/saveJsonData/${saveType}`,
    method: "post",
    data: data
  })
}

// 删除接口类型
export function delExcPortConfigType(portId, type) {
  return request({
    url:  `/pm/excPortConfig/${portId}/${type}`,
    method: 'delete'
  })
}

// 修改映射值
export function updateExcPortConfigMappingFormula( data ) {
  return request({
    url:  "/pm/excPortConfig/editList",
    method: 'post',
    data: data
  })
}

// 修改字段顺序
export function updateExcPortConfigOrderNum( data ) {
  return request({
    url:  "/pm/excPortConfig/updateOrderNum",
    method: 'post',
    data: data
  })
}

// 标准订单JSON映射值
export function addStandardOrderList( portId, data ) {
  return request({
    url:  `/pm/excPortConfig/addList/${portId}`,
    method: 'post',
    data: data
  })
}
